﻿using System.Web.Mvc;

namespace QDT.Web.Admin.Controllers
{
    public class ImageController : Controller
    {

        public ActionResult GetImage(string file)
        {
            var path = System.Configuration.ConfigurationManager.AppSettings["ImageSavePath"];
            var dirPath = path + "image";
            var filePath = dirPath + file;
            Response.ContentType = "image/jpg";
            Response.WriteFile(filePath);
            Response.End();
            return null; 
        }

        public ActionResult GetThumb(string file)
        {
            var path = System.Configuration.ConfigurationManager.AppSettings["ImageSavePath"];
            var dirPath = path + "thumb";
            var filePath = dirPath + file;
            Response.ContentType = "image/jpg";
            Response.WriteFile(filePath);
            Response.End();
            return null; 
        }

        public ActionResult GetPdf(string file)
        {
            Response.ContentType = "application/pdf";
            Response.WriteFile(file);
            Response.End();
            return null;
        }

    }
}
